// component/business-purchaser/index.js
Component({
    /**
     * 组件的属性列表
     */
    options: {
        styleIsolation: "shared",
    },

    /**
     * 组件的初始数据
     */
    data: {
        active: 0,
        tabList: [{
            title: "交易",
            component: "allBusiness"
        },{
            title: "待发货",
            component: "waitDeliver"
        }, {
            title: "已发货",
            component: "hadDeliver"
        }]
    },

    /**
     * 组件的方法列表
     */
    methods: {
        onChange(e) {
            this.setData({
                active: e.detail.index
            })
        },
        bookPicker(item) {
            this.triggerEvent('bookPicker', item.detail)
        },
        onPullDownRefresh() {
            const childComponent = this.selectComponent('.component');
            if (childComponent.onPullDownRefresh) {
                childComponent.onPullDownRefresh() 
            } else {
                wx.stopPullDownRefresh();
            }
        },
        onReachBottom() {
            const childComponent = this.selectComponent('.component');
            childComponent.onReachBottom && childComponent.onReachBottom()
        }
    }
})